package cn.edu.cug.cs.gtl.docsrv.txt.block;

import cn.edu.cug.cs.gtl.docsrv.shp.querier.DefaultFeatureQuerier;
import cn.edu.cug.cs.gtl.docsrv.shp.querier.FeatureQuerier;
import cn.edu.cug.cs.gtl.extractor.ImageExtractor;
import cn.edu.cug.cs.gtl.extractor.ShapeExtractor;
import cn.edu.cug.cs.gtl.extractor.TextExtractor;
import cn.edu.cug.cs.gtl.mybatis.mapper.txt.TxtAll;
import cn.edu.cug.cs.gtl.mybatis.mapper.txt.TxtAll;
import cn.edu.cug.cs.gtl.mybatis.mapper.txt.TxtAll;
import org.locationtech.jts.geom.Envelope;
import org.locationtech.jts.geom.Geometry;
import org.opengis.feature.simple.SimpleFeature;
//import sun.java2d.pipe.BufferedTextPipe;

import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.List;

/**
 * 图形单元块，由三个文件构成，SHP、DBF、SHX
 * TxtManager管理的基本单元就是ShapeBlock
 */
public class TextBlock {
    Envelope envelope;
    TxtAll txtAll;
    String[] textList;

        
    public TextBlock(TxtAll txtAll) {
        try{
            this.txtAll = txtAll;
            this.textList = TextExtractor.parseToStrings(Arrays.toString(txtAll.getTxtRawBytes()));
        }
        catch (Exception e){
            e.printStackTrace();
        }

    }

    public Envelope getEnvelope() {
        return envelope;
    }

    public void setEnvelope(Envelope e) {
        this.envelope=e;
    }

    public TxtAll getTextAll() {
        return txtAll;
    }

    public String[] getTextList() {
        return textList;
    }

}
